<!doctype html>
<html xmlns:v-bind="http://www.w3.org/1999/xhtml">
    <head>
        <meta charset="utf-8">
        <meta content="搜索关键词" name="keywords" />
        <meta content="网站介绍" name="description" />
        <meta content="width=device-width, initial-scale=1, maximum-scale=1" name="viewport">
        <title>企业资讯 - GOLF葡萄酒官网</title>
        <link rel="stylesheet" href="/assets/modular/web/css/base.css" />
        <link rel="stylesheet" href="/assets/common/libs/layui/css/layui.css"/>
        <script type="text/javascript" src="/assets/common/libs/jquery/jquery-3.2.1.min.js"></script>
        <script type="text/javascript" src="/assets/modular/web/js/vue.min.js"></script>
        <style type="text/css">
            .w-nav-box .w-nav-conn ul li:nth-child(3) a{ background-color: #c40000; color:#fff;}
        </style>
    </head>
    <body>
    <div id="enterInfoVue" class="layui-fluid wrapper">
        <!-- 头部：标题和导航列 start -->
        <header>
            <div class="layui-row">
                <div class="w-title-phone-box">
                    <div class="layui-col-xs6 layui-col-sm6 layui-col-md6 layui-col-lg6">
                        <div class="title-box">
                            <h1>
                                <a href="/" id="backToTop" v-text="infoSet.topName"></a>
                                <i v-if="infoSet.id == '' || infoSet.id == null" class="layui-icon layui-icon-loading layui-icon layui-anim layui-anim-rotate layui-anim-loop" style="font-size: 26px;"></i>
                            </h1>
                        </div>
                    </div>
                    <div class="layui-col-xs6 layui-col-sm6 layui-col-md6 layui-col-lg6">
                        <div class="phone-box">
                            <p><img src="/assets/modular/web/images/phone.png">{{infoSet.topPhone}}</p>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-row">
                <div class="layui-col-xs12 layui-col-sm12 layui-col-md12 layui-col-lg12">
                    <div class="w-nav-box">
                        <nav class="w-nav-conn">
                            <ul>
                                <li><a href="/">首页</a></li>
                                <li><a href="/web/brank/">品牌理念</a></li>
                                <li><a href="/web/enterInfo/">企业资讯</a></li>
                                <li><a href="/web/merToJoin/">招商加盟</a></li>
                                <li><a href="/web/aboutMe/">关于我们</a></li>
                            </ul>
                        </nav>
                    </div>
                </div>
            </div>
        </header>
        <!-- 头部：标题和导航列 end -->

        <!-- we-banner-one start -->
        <div class="layui-row">
            <div class="layui-col-xs12 layui-col-sm12 layui-col-md12 layui-col-lg12">
                <div class="we-banner-one">
                    <img v-bind:src="'/hyRedWineFile/images/' + banner.fileName" v-bind:alt="banner.fileName">
                </div>
            </div>
        </div>
        <!-- we-banner-one end -->

        <!-- we-banner-two start -->
        <div class="layui-row">
            <div class="layui-col-xs12 layui-col-sm12 layui-col-md12 layui-col-lg12">
                <div class="we-banner-two">
                    <div class="layui-row">
                        <div class="layui-col-xs12 layui-col-sm5 layui-col-md5 layui-col-lg5">
                            <div class="we-banner-tbox">
                                <img v-bind:src="'/hyRedWineFile/images/' + enterInfoList[0].fileName" v-bind:alt="enterInfoList[0].fileName">
                            </div>
                        </div>
                        <div class="layui-col-xs12 layui-col-sm7 layui-col-md7 layui-col-lg7 we-banner-tcbox">
                            <h1 class="we-banner-ttitle" v-text="enterInfoList[0].title"></h1>
                            <div class="we-banner-tcon" v-html="enterInfoList[0].content"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- we-banner-two end -->

        <!-- wb-article-list start -->
        <div class="layui-row">
            <div class="layui-col-xs12 layui-col-sm12 layui-col-md12 layui-col-lg12">
                <div class="wb-article-list">
                    <div v-for="(item, index) in enterInfoList" class="layui-row" :key="item.id">
                        <div class="layui-col-xs12 layui-col-sm12 layui-col-md12 layui-col-lg12">
                            <div class="wb-article-lbox">
                                 <h3><a v-bind:href="'/web/enterInfo/articleDetail?enterInfoId=' + item.id" v-text="item.title"></a><time v-text="item.createDateValue"></time></h3>
                                <div class="wb-article-lboxcon" v-html="item.content"></div>
                            </div>
                        </div>
                    </div>

                    <!-- 分页 -->
                    <div id="pageContent"></div>

                </div>
            </div>
        </div>
        <!-- wb-article-list end -->

        <!-- 页脚 start -->
        <footer>
            <div class="layui-row">
                <div class="layui-col-xs12 layui-col-sm12 layui-col-md12 layui-col-lg12">
                    <div class="foot-into-tbox">
                        <div class="layui-col-xs12 layui-col-sm12 layui-col-md4 layui-col-lg4">
                            地址：{{infoSet.bmAddress}}
                        </div>
                        <div class="layui-col-xs12 layui-col-sm12 layui-col-md4 layui-col-lg4">
                            电话：{{infoSet.bmPhone}}
                        </div>
                        <div class="layui-col-xs12 layui-col-sm12 layui-col-md4 layui-col-lg4">
                            邮箱：{{infoSet.bmEmail}}
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-row">
                <div class="layui-col-xs12 layui-col-sm12 layui-col-md12 layui-col-lg12">
                    <div class="foot-into-bbox">
                        <p>
                            {{infoSet.bmBase}} | {{infoSet.bmCompanyName}} | 版权所有
                        </p>
                        <p>
                            技术支持 | {{infoSet.bmDeveName}}
                        </p>
                    </div>
                </div>
            </div>
        </footer>
        <!-- 页脚 end -->

        <!-- 返回顶部 start -->
        <div class="backToTop">
            <a href="#backToTop"><img src="/assets/modular/web/images/backTop.png"></a>
        </div>
        <!-- 返回顶部 end -->

    </div>
    <script type="text/javascript" src="/assets/common/libs/layui/layui.js"></script>
    <script>
        var enterInfoVue = new Vue({
            el: '#enterInfoVue',
            data: function () {
                return {
                    infoSet: [], //基本信息配置
                    enterInfoList: [], //企业资讯列表
                    banner: [], //banner企业资讯背景图
                    count: 0, //动态总数
                    curr: 1, //页数
                    limit: 10 //每页条数
                }
            },
            created: function () {
                const me = this;
                me.$nextTick(function () {
                    me.getInitData();
                    me.getEnterInfoList(me.curr, me.limit);
                });
            },
            methods: {
                //初始化基本信息
                getInitData: function(){
                    const me = this;
                    $.ajax({
                        type: 'POST',
                        url: '/web/enterInfo/getInitData',
                        data: {},
                        dataType: 'JSON',
                        success: function(data){
                            me.infoSet = data.infoSet;
                            me.banner = data.banner;

                            me.initBackTop(); //初始化返回顶部按钮
                        },
                        error: function(error){
                            layui.use('layer', function(){
                                var layer = layui.layer;
                                layer.msg(error, {icon:2});
                            });
                        }
                    })
                },

                //企业资讯列表
                getEnterInfoList: function(curr, limit){
                    const me = this;
                    $.ajax({
                        type: 'POST',
                        url: '/web/enterInfo/getEnterInfoList',
                        data: {
                            page: curr,
                            limit: limit
                        },
                        dataType: 'JSON',
                        success: function(data){
                            me.enterInfoList = data.enterInfoList.data;
                            me.count = data.enterInfoList.count;

                            me.initPage(); //初始化分页
                        },
                        error: function(error){
                            layui.use('layer', function(){
                                var layer = layui.layer;
                                layer.msg(error, {icon:2});
                            });
                        }
                    })
                },

                //初始化返回顶部按钮
                initBackTop: function(){
                    $(window).bind("scroll", function () {
                        var sTop = $(window).scrollTop();
                        var sTop = parseInt(sTop);
                        if (sTop >= 50) {
                            $(".backToTop").slideDown();
                        }else {
                            $(".backToTop").slideUp();
                        }
                    });
                },

                //分页
                initPage: function(){
                    const me = this;
                    layui.use('laypage', function(){
                        var laypage = layui.laypage;
                        //执行一个laypage实例
                        laypage.render({
                            elem: 'pageContent' //注意，这里的 test1 是 ID，不用加 # 号
                            ,count: me.count //数据总数，从服务端得到
                            ,limit: me.limit //每页条数
                            ,curr: me.curr //页数
                            // ,limits: [10, 20, 30, 40, 50] //每页条数的选择项
                            ,layout: ['prev', 'page', 'next', 'count'] //自定义排版
                            ,theme: '#FF5722'
                            ,jump: function(obj, first){ //obj包含了当前分页的所有参数
                                //首次不执行
                                if(!first){
                                    me.curr = obj.curr;
                                    me.getEnterInfoList(obj.curr, obj.limit);
                                }
                            }
                        });
                    });
                }
            }
        });
    </script>
    </body>
</html>